package com.example.cms.service.Impl;

import com.example.cms.dao.LoginLogDao;
import com.example.cms.entity.LoginLog;
import com.example.cms.pojo.Mesagge;
import com.example.cms.pojo.QueryPage;
import com.example.cms.service.LoginLogService;
import com.example.cms.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName LoginLogServiceImpl
 * @Descriptiom TODO
 * @Author Sunbird
 * @Date 2018/12/15 15:03
 * @Version 1.0
 **/
@Service
public class LoginLogServiceImpl implements LoginLogService {
    @Autowired
    private LoginLogDao loginLogDao;

    @Override
    public List<LoginLog> selectLoginPage(QueryPage queryPage, Mesagge mesagge) {
        queryPage.setPageSize(10);
        queryPage.setCurr_page((queryPage.getCurr_page()-1)*queryPage.getPageSize());
        List<LoginLog> loginLogs=loginLogDao.selectLoginLog(queryPage);
        mesagge.setList(loginLogs);
        return loginLogs;
    }
}
